﻿using CsvHelper;
using CsvHelper.Configuration;
using CsvHelper.TypeConversion;
using System;
using System.Globalization;
using System.IO;

public class SafeDateTimeConverter : DateTimeConverter
{
    public override object ConvertFromString(string text, IReaderRow row, MemberMapData memberMapData)
    {
        if (DateTime.TryParse(text, out DateTime dateValue))
        {
            return dateValue;
        }

        // 返回 null 或指定默认值
        return default(DateTime);
    }
}
